<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('order_sn')->default('')->comment('订单号');
            $table->decimal('total_price')->default(0.00)->comment('订单金额');
            $table->decimal('goods_price')->default(0.00)->comment('商品价格');
            $table->decimal('shopping_price')->default(0.00)->comment('运费');
            $table->tinyInteger('status')->default(0)->comment('订单状态');
            $table->string('remark')->default('')->comment('订单备注');
            $table->string('shopping_no')->default('')->comment('物流单号');
            $table->timestamp('pay_at')->nullable()->comment('支付时间');
            $table->string('out_trade_no')->default('')->comment('第三方订单号');
            $table->string('buy_name')->default('')->comment('购买人姓名');
            $table->string('address')->default('')->comment('收货地址');
            $table->string('zip_code')->default('')->comment('邮政编码');
            $table->string('country')->default('')->comment('国家');
            $table->string('city')->default('')->comment('城市');
            $table->string('email')->default('')->comment('邮箱');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order');
    }
}
